%h1.page_title= @user.login
%table.edit_user
  %tr
    %td.field_title E-mail:
    %td.field= @user.email
  %tr
    %td Joined on:
    %td= @user.created_at.strftime("%B %o, %Y")
  - if logged_in? && (@user == current_user || current_user.is_admin?)
    %tr
      %td.field_title Edit:
      %td.field
        [
        %a{:href => edit_user_url} edit
        ]
    %tr
      %td.field_title Galleries:
      %td.field
        [
        %a{:href => user_galleries_url(@user), :title => "View #{pluralize(@user.galleries.length, "gallery")}"}= "View #{pluralize(@user.galleries.length, "gallery")}"
        ]
    - if current_user.is_admin?
      - form_for @user, users_url, :html => {:method => :delete} do |form|
        %tr
          %td.field_title Delete:
          %td= submit_tag 'Delete'
%h2= @user.login + "'s comments: "
%div.user_comments
  - @user.comments.each do |comment|
    %div.comment_container
      %div.creation_information
        %div.user_login
          %a{:href => user_url(comment.user)}= comment.user.login
        %div.comment_time
          = comment.created_at.strftime("%m/%d/%y at %I:%M %p")
        - if logged_in? && current_user.is_admin?
          %div.delete_comment
            - form_for comment, :html => {:method => :delete} do |form|
              = submit_tag "delete"
      %div.user_comment
        = comment.text
        - if comment.for_photo?
          %div.comment_photo
            %a{:href => photo_url(comment.photo)}
              %img.photo_thumb{:src => comment.photo.public_filename(:thumb)}
        - if comment.for_video?
          %div.comment_video
            %a{:href => video_url(comment.video)}
              %img.video_thumb{:src => comment.video.thumbnail}
    %div.clear_fix